<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title> 3-7 二维数组</title>
    <link rel="stylesheet" type="text/css" href="../../../css/style.css"/>
    <style type="text/css">
    </style>

    <script type="text/javascript">
        var Myarr = [[0,0,0,0,0,0],[0,1,2,3,4,5],[0,2,4,6,8,10]];
        Myarr[2][5]=2*5;
        document.write(Myarr.length+"<br>");

        var myarr=new Array();  //先声明一维
        for(var i=1;i<4;i++)    //一维长度为4
        {
            myarr[i]=new Array();   //再声明二维
            for(var j=1;j<6;j++)    //二维长度为6
            {
                myarr[i][j]=i*j;    // 赋值，每个数组元素的值为i*j
                document.write("myarr["+i+"]["+j+"]的值:"+myarr[i][j]+"<br>");
            }
        }

        document.write("<hr>");

        var myarr2=new Array();
        for(var i=0;i<3;i++){
            myarr2[i]=new Array();
            for(var j=0;j<5;j++){
                myarr2[i][j]=i*j;
                document.write("myarr2["+i+"]["+j+"]的值:"+myarr2[i][j]+"<br>");
            }
        }
    </script>
</head>

<body>
<div align="center">
    <p><a href="../../index.php#jsjjp" class="fontSize" title="点击进入该目录">目录</a></p>
</div>

<!--<input type="button" onclick="zhencha()" value="点击查询"/>-->

<script type="text/javascript">

</script>

</body>
</html>
